import {
	request
} from "../utils/request";
//用户注册
export function apiDeviceList(data = {}) {
	return request({
		url: "/user/app/device/list",
		data,
	})
}

//向设备发送指令
export function apiDeviceSendCmd(data = {}) {
	return request({
		url: "/iot/app/send/cmd2dev",
		data,
		method: "POST"
	})
}
//获取某设备当前信息
export function apiGetDevicePosition(data = {}) {
	return request({
		url: "/user/app/get/dev/profile",
		data,
	})
}

//获取设备某天轨迹信息
export function apiDeviceDayTrajectory(data = {}) {
	return request({
		url: "/user/app/device/day/trajectory",
		data,
	})
}
//绑定设备
export function apiBindDevice(data = {}) {
	return request({
		url: "/user/app/bind/device",
		data,
		method: "POST"
	})
}
//获取设备信息 
export function apiGetDeviceInfo(data={}){
	return request({
		url:"/user/app/get/dev/info",
		data,
	})
}

//绑定设备
export function apiSetDeviceName(data = {}) {
	return request({
		url: "/user/app/named/device",
		data,
		method: "POST"
	})
}

//获取订阅商品列表
export function apiGetSubscribeGoodsList(data = {}) {
	return request({
		url: "/user/app/goods/list",
		data,
	})
}

//设备消息列表
export function apiGetDeviceMsgList(data = {}) {
	return request({
		url: "/user/app/device/msg/list",
		data,
	})
}
//给设备设置头像

 export function apiSetDeviceHeadImg(data = {}) {
	return request({
		url: "/user/app/device/set/head",
		data,
		method: "POST",
		upload:true
	})
}

//给设备添加围栏

 export function apiAddDeviceFence(data = {}) {
	return request({
		url: "/iot/app/device/add/fence",
		data,
		method: "POST",
	})
}
//删除设备围栏
 export function apiDeleteDeviceFence(data = {}) {
	return request({
		url: "/iot/app/device/del/fence",
		data,
		method: "POST",
	})
}

//获取设备围栏列表
 export function apiGetDeviceFenceList(data = {}) {
	return request({
		url: "/iot/app/device/fence/list",
		data,
		method: "POST",
	})
}


//获取设备围栏列表
 export function apiSetDeviceFenceState(data = {}) {
	return request({
		url: "/iot/app/device/fence/set/state",
		data,
		method: "POST",
	})
}
//设置SOS 
 export function apiSetDeviceSOSNumber(data = {}) {
	return request({
		url: "/iot/app/set/device/sos",
		data,
		method: "POST",
	})
}

//SOS list 
 export function apiGetDeviceSOSList(data = {}) {
	return request({
		url: "/iot/app/get/device/sos",
		data,
	})
}


//上报设备cid
 export function apiSubmitDeviceClientId(data = {}) {
	return request({
		url: "/iot/app/submit/cid",
		data,
		method: "POST",
	})
}
//是否可以升级
 export function apiDeviceIfNeedUpgrade(data = {}) {
	return request({
		url: "/iot/app/device/need/upgrade",
		data,
	})
}
//升级
 export function apiDeviceUpgrade(data = {}) {
	return request({
		url: "/iot/app/device/upgrade/ack",
		data,
		method: "POST",
	})
}

//test push  
 export function apiTestPush(data = {}) {
	return request({
		url: "/iot/app/push/test",
		data,
	})
}
